package com.example.xunua_zhinengjiaotong;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import com.example.xunua_zhinengjiaotong.Dialog.ludeng1Dialog;
import com.example.xunua_zhinengjiaotong.Dialog.ludeng2Dialog;
import com.example.xunua_zhinengjiaotong.Dialog.ludeng3Dialog;
import com.example.xunua_zhinengjiaotong.utils.MyApp;

public class ludengActivity extends AppCompatActivity implements View.OnClickListener {
    private ImageView img_back;
    private RelativeLayout rl1,rl2,rl3;
    private MyApp myApp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ludeng);
        initView();
    }

    private void initView() {
        myApp= (MyApp) getApplication();
        img_back=findViewById(R.id.ludeng_img_back);
        img_back.setOnClickListener(this);
        rl1=findViewById(R.id.ludeng_rl1);
        rl2=findViewById(R.id.ludeng_rl2);
        rl3=findViewById(R.id.ludeng_rl3);
        rl1.setOnClickListener(this);
        rl2.setOnClickListener(this);
        rl3.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ludeng_img_back:
            finish();
            break;
            case R.id.ludeng_rl1:
                ludeng1Dialog ludeng1Dialog=new ludeng1Dialog(myApp,ludengActivity.this, new ludeng1Dialog.Ludeng1Listener() {
                    @Override
                    public void sendMessage(String s) {
                        Toast.makeText(ludengActivity.this, "s:"+s, Toast.LENGTH_SHORT).show();
                    }
                });
                ludeng1Dialog.show();
                break;
            case R.id.ludeng_rl2:
                ludeng2Dialog ludeng2Dialog=new ludeng2Dialog(myApp,ludengActivity.this);
                ludeng2Dialog.show();
                break;
            case R.id.ludeng_rl3:
                ludeng3Dialog ludeng3Dialog=new ludeng3Dialog(myApp,ludengActivity.this);
                ludeng3Dialog.show();
                break;
        }
    }
    @Override
    public void onBackPressed() {
        // super.onBackPressed();
    }
}
